//
//  UIBarButtonItem+NYExtension.m
//  BS
//
//  Created by neal on 15/8/16.
//  Copyright (c) 2015年 Neal. All rights reserved.
//

#import "UIBarButtonItem+NYExtension.h"

@implementation UIBarButtonItem (NYExtension)

+ (instancetype)itemWithTarget:(id)target action:(SEL)action image:(UIImage *)image Highlightedimage:(UIImage *)highimage
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:image forState:UIControlStateNormal];
    [button setImage:highimage forState:UIControlStateHighlighted];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [button sizeToFit];
    return [[self alloc]initWithCustomView:button];
}
@end
